package tests;

import static org.junit.Assert.*;

import java.util.ArrayList;

import mainService.ServiceParams;
import mainService.services.HttpFileServer;
import mainService.services.InserisciLogService;

import org.junit.Before;
import org.junit.Test;

public class TestInserimentoLog {
	
	InserisciLogService inserimento;
	HttpFileServer http;
	ServiceParams params;

	@Before
	public void setUp() throws Exception {
		inserimento=new InserisciLogService();
		http = new HttpFileServer();
		params = new ServiceParams("");
	}

	@Test
	public void testGetServiceResult() {
		
		
		params.addParam("file", "inserimentoLogRiuscito.html");
				
		ArrayList<String> giusto = http.getServiceResult(params);
		
		ArrayList<String> risultati = new ArrayList<String>();
				risultati=inserimento.getServiceResult(new ServiceParams(
						"task=2&ore=8&data=15/02/2014&description=prova"));
		
		assertEquals(giusto, risultati);
	}

}
